import 'package:flutter/animation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_corner/page/HomePage.dart';
import 'package:flutter_corner/page/animation/GrowTransition.dart';

class PageCurvedAnimation extends StatefulWidget {
  _PageCurvedAnimationSate createState() => new _PageCurvedAnimationSate();
}

class _PageCurvedAnimationSate extends State<PageCurvedAnimation> with SingleTickerProviderStateMixin {
  Animation<double> animation;
  AnimationController controller;

  initState() {
    super.initState();
    controller = new AnimationController(
        duration: const Duration(milliseconds: 2000), vsync: this);
    final CurvedAnimation curve =
    new CurvedAnimation(parent: controller, curve: Curves.easeIn);
    animation = new Tween(begin: 0.0, end: 300.0).animate(curve);
    controller.forward();
  }

  Widget build(BuildContext context) {
    return new GrowTransition(child: new HomePage(), animation: animation);
  }

  dispose() {
    controller.dispose();
    super.dispose();
  }
}


